package cn.iocoder.yudao.module.forward.dal.mysql.firm;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.forward.dal.dataobject.firm.FirmDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.forward.controller.admin.firm.vo.*;

/**
 * 厂商 Mapper
 *
 * @author zhang
 */
@Mapper
public interface FirmMapper extends BaseMapperX<FirmDO> {

    default PageResult<FirmDO> selectPage(FirmPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FirmDO>()
                .likeIfPresent(FirmDO::getName, reqVO.getName())
                .eqIfPresent(FirmDO::getCode, reqVO.getCode())
                .eqIfPresent(FirmDO::getEnable, reqVO.getEnable())
                .betweenIfPresent(FirmDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FirmDO::getId));
    }

}